/* let numbers = [1,2,3];
//把函数可以定义为变量
const mapper = num=>num*2;
//可以把函数作为参数传递给其它函数
const doubled = numbers.map(mapper);
console.log(doubled); */

function multiplier(factor){
    return function(x){
        return x * factor;
    }
}
const timesTwo = multiplier(2);
console.log(timesTwo(5))
